package com.github.freewu.mvp.bean;

import com.google.gson.annotations.SerializedName;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * Created by free on 16-5-23.
 */
public class ServerListBean<T> extends ServerBaseBean{
    public ServerListBean() {
        this.setTime(System.currentTimeMillis());
    }

    public ServerListBean(List<T> data) {
        this.data = data;

        this.setTime(System.currentTimeMillis());
    }

    /**
     * 被包含的多个消息实体
     */
    private List<T> data;

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    /**
     * 增加一个数据
     * @param data 数据
     */
    public void addData(T data){
        if (this.data==null){
            this.data=new ArrayList<T>(5);
        }
        this.data.add(data);
    }
}